#ifndef CRC32_H__
#define CRC32_H__

typedef struct Struct_CRC32_16 {
    char crcName[16];
    unsigned int crcPoly;
    unsigned int crcInit;
    unsigned int crcXor;
    unsigned int crcTable[16];
    unsigned char crcRefIn;
    unsigned char crcRefOut;
} CRC32_16;

typedef struct Struct_CRC32_256 {
    char crcName[16];
    unsigned int crcPoly;
    unsigned int crcInit;
    unsigned int crcXor;
    unsigned int crcTable[256];
    unsigned char crcRefIn;
    unsigned char crcRefOut;
} CRC32_256;

void create_crc32_table16(CRC32_16 * p_crc32_16);
void create_crc32_table256(CRC32_256 * p_crc32_256);
void prepare_crc32_with_table16(CRC32_16 * p_crc, unsigned int * crc32);
void process_crc32_with_table16(CRC32_16 * p_crc, const unsigned char * character, unsigned int * crc32);
void complete_crc32_with_table16(CRC32_16 * p_crc, unsigned int * crc32);
void prepare_crc32_with_table256(CRC32_256 * p_crc, unsigned int * crc32);
void process_crc32_with_table256(CRC32_256 * p_crc, const unsigned char * character, unsigned int * crc32);
void complete_crc32_with_table256(CRC32_256 * p_crc, unsigned int * crc32);
unsigned int generate_crc32(void *p_crc, unsigned int crc_table_size, const unsigned char * data, unsigned int length);

#endif //CRC32_H__
